Skip to content

fix: tighten light-client zeroed-header checks to match spec#9419

Draft
ensi321 wants to merge 2 commits into
unstablefrom
nc/lc-zeroed-header-spec-parity
Draft

fix: tighten light-client zeroed-header checks to match spec#9419
ensi321 wants to merge 2 commits into
unstablefrom
nc/lc-zeroed-header-spec-parity

Conversation

@ensi321
Copy link
Copy Markdown
Contributor

@ensi321 ensi321 commented May 28, 2026

Summary

  • isZeroedHeader (packages/state-transition/src/lightClient/spec/utils.ts:108) only checked bodyRoot; spec (altair/light-client/sync-protocol.md process_light_client_update) requires whole-struct equality against LightClientHeader(). Same loosening present in isZeroedSyncCommittee. Switched both to full SSZ-struct equality.
  • Added isFinalityUpdate(update) guard at the store.finalizedHeader write site in processLightClientUpdate as defense-in-depth.
  • Removed now-unused ZERO_PUBKEY export.

Background

A reporter flagged that the loose isZeroedHeader check allows a non-finality LightClientUpdate to carry an attacker-controlled finalizedHeader (arbitrary slot/proposerIndex/parentRoot/stateRoot, only bodyRoot=0) past validateLightClientUpdate. processLightClientUpdate.ts:47-51 then overwrites store.finalizedHeader with it, since the conditional was gated only on the 2/3 sync-committee threshold and a higher slot — not on isFinalityUpdate(update). A MITM or malicious beacon-API endpoint could thus point a connected light client at any attacker-chosen state root.

AI Assistance Disclosure

Drafted with Claude (claude-opus-4-7).

🤖 Generated with Claude Code

…atch spec

`isZeroedHeader` only compared `bodyRoot`, and `isZeroedSyncCommittee` only
compared `pubkeys[0]`. The consensus-specs reference
(`altair/light-client/sync-protocol.md` `process_light_client_update`)
requires whole-struct equality against `LightClientHeader()` and
`SyncCommittee()` respectively. The loose checks let a non-finality
`LightClientUpdate` carry an attacker-controlled `finalizedHeader`
(arbitrary slot/proposerIndex/parentRoot/stateRoot, only `bodyRoot=0`)
past validation, and `processLightClientUpdate` would then overwrite
`store.finalizedHeader` with it.

Switch both helpers to full SSZ-struct equality, matching the spec.

Also add an `isFinalityUpdate(update)` guard on the
`store.finalizedHeader` write site in `processLightClientUpdate` as
defense-in-depth, so a non-finality update can never reach the
overwrite branch regardless of any future regression in the zero checks.

In-tree impact is limited: the light-client consumer was extracted to
an external repo in #9346, and the in-repo callers of this code are the
spec-test runner and downstream importers of
`@lodestar/state-transition/light-client`. The published package surface
still exposes the bug to any consumer that runs `validateLightClientUpdate`
/ `LightclientSpec` against untrusted updates.

AI Assistance Disclosure: drafted with Claude (claude-opus-4-7).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ensi321 ensi321 changed the title fix(state-transition): tighten light-client zeroed-header checks to match spec fix: tighten light-client zeroed-header checks to match spec May 28, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the security and spec-compliance of the light client update processing. It adds a defense-in-depth check isFinalityUpdate(update) when updating the finalized header. Additionally, it strengthens isZeroedHeader and isZeroedSyncCommittee by performing full equality checks against zeroed structures instead of partial checks, preventing potential exploits where arbitrary data could be smuggled. There are no review comments, so I have no feedback to provide.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 3efa77c Previous: b68fc56 Ratio
Full columns - reconstruct single blob out of 10 29.749 us/op 93.439 us/op 0.32
Full benchmark results
Benchmark suite Current: 3efa77c Previous: b68fc56 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 933.78 us/op 856.28 us/op 1.09
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 37.925 us/op 38.822 us/op 0.98
BLS verify - blst 697.46 us/op 758.84 us/op 0.92
BLS verifyMultipleSignatures 3 - blst 1.2681 ms/op 1.3641 ms/op 0.93
BLS verifyMultipleSignatures 8 - blst 2.0724 ms/op 2.1736 ms/op 0.95
BLS verifyMultipleSignatures 32 - blst 6.7729 ms/op 6.8002 ms/op 1.00
BLS verifyMultipleSignatures 64 - blst 12.710 ms/op 13.133 ms/op 0.97
BLS verifyMultipleSignatures 128 - blst 24.930 ms/op 25.392 ms/op 0.98
BLS deserializing 10000 signatures 615.41 ms/op 627.48 ms/op 0.98
BLS deserializing 100000 signatures 6.2379 s/op 6.3276 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst 735.54 us/op 698.25 us/op 1.05
BLS verifyMultipleSignatures - same message - 8 - blst 916.76 us/op 946.58 us/op 0.97
BLS verifyMultipleSignatures - same message - 32 - blst 1.4654 ms/op 1.5724 ms/op 0.93
BLS verifyMultipleSignatures - same message - 64 - blst 2.2921 ms/op 2.4229 ms/op 0.95
BLS verifyMultipleSignatures - same message - 128 - blst 3.9116 ms/op 4.0222 ms/op 0.97
BLS aggregatePubkeys 32 - blst 17.372 us/op 17.702 us/op 0.98
BLS aggregatePubkeys 128 - blst 62.223 us/op 63.204 us/op 0.98
getSlashingsAndExits - default max 49.386 us/op 47.097 us/op 1.05
getSlashingsAndExits - 2k 340.87 us/op 332.91 us/op 1.02
proposeBlockBody type=full, size=empty 675.23 us/op 660.50 us/op 1.02
isKnown best case - 1 super set check 194.00 ns/op 172.00 ns/op 1.13
isKnown normal case - 2 super set checks 159.00 ns/op 164.00 ns/op 0.97
isKnown worse case - 16 super set checks 161.00 ns/op 161.00 ns/op 1.00
validate api signedAggregateAndProof - struct 1.4455 ms/op 1.5226 ms/op 0.95
validate gossip signedAggregateAndProof - struct 1.4548 ms/op 1.5158 ms/op 0.96
batch validate gossip attestation - vc 640000 - chunk 32 106.72 us/op 108.38 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 64 96.520 us/op 94.632 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 128 90.691 us/op 88.880 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 256 84.392 us/op 85.521 us/op 0.99
bytes32 toHexString 289.00 ns/op 285.00 ns/op 1.01
bytes32 Buffer.toString(hex) 156.00 ns/op 178.00 ns/op 0.88
bytes32 Buffer.toString(hex) from Uint8Array 227.00 ns/op 249.00 ns/op 0.91
bytes32 Buffer.toString(hex) + 0x 158.00 ns/op 183.00 ns/op 0.86
Return object 10000 times 0.20570 ns/op 0.21510 ns/op 0.96
Throw Error 10000 times 3.3138 us/op 3.2725 us/op 1.01
toHex 82.197 ns/op 123.43 ns/op 0.67
Buffer.from 75.088 ns/op 102.38 ns/op 0.73
shared Buffer 49.230 ns/op 56.880 ns/op 0.87
fastMsgIdFn sha256 / 200 bytes 1.3850 us/op 1.4870 us/op 0.93
fastMsgIdFn h32 xxhash / 200 bytes 151.00 ns/op 153.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 200 bytes 194.00 ns/op 201.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 4.4860 us/op 4.7920 us/op 0.94
fastMsgIdFn h32 xxhash / 1000 bytes 234.00 ns/op 245.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 1000 bytes 239.00 ns/op 247.00 ns/op 0.97
fastMsgIdFn sha256 / 10000 bytes 40.002 us/op 42.307 us/op 0.95
fastMsgIdFn h32 xxhash / 10000 bytes 1.2510 us/op 1.2920 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 804.00 ns/op 835.00 ns/op 0.96
send data - 1000 256B messages 4.0402 ms/op 3.8670 ms/op 1.04
send data - 1000 512B messages 4.8258 ms/op 4.3347 ms/op 1.11
send data - 1000 1024B messages 4.3459 ms/op 4.4963 ms/op 0.97
send data - 1000 1200B messages 4.9818 ms/op 4.7479 ms/op 1.05
send data - 1000 2048B messages 5.7489 ms/op 4.9372 ms/op 1.16
send data - 1000 4096B messages 6.2115 ms/op 5.6531 ms/op 1.10
send data - 1000 16384B messages 13.718 ms/op 17.170 ms/op 0.80
send data - 1000 65536B messages 272.32 ms/op 211.82 ms/op 1.29
enrSubnets - fastDeserialize 64 bits 689.00 ns/op 744.00 ns/op 0.93
enrSubnets - ssz BitVector 64 bits 254.00 ns/op 265.00 ns/op 0.96
enrSubnets - fastDeserialize 4 bits 102.00 ns/op 103.00 ns/op 0.99
enrSubnets - ssz BitVector 4 bits 264.00 ns/op 260.00 ns/op 1.02
prioritizePeers score -10:0 att 32-0.1 sync 2-0 194.41 us/op 206.54 us/op 0.94
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 237.08 us/op 231.83 us/op 1.02
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 330.63 us/op 353.24 us/op 0.94
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 607.07 us/op 606.20 us/op 1.00
prioritizePeers score 0:0 att 64-1 sync 4-1 705.95 us/op 700.39 us/op 1.01
array of 16000 items push then shift 1.2226 us/op 1.3002 us/op 0.94
LinkedList of 16000 items push then shift 7.8670 ns/op 6.6810 ns/op 1.18
array of 16000 items push then pop 69.378 ns/op 68.689 ns/op 1.01
LinkedList of 16000 items push then pop 6.3760 ns/op 5.9490 ns/op 1.07
array of 24000 items push then shift 1.7992 us/op 1.9162 us/op 0.94
LinkedList of 24000 items push then shift 8.0370 ns/op 6.2850 ns/op 1.28
array of 24000 items push then pop 100.99 ns/op 94.632 ns/op 1.07
LinkedList of 24000 items push then pop 6.4070 ns/op 5.9690 ns/op 1.07
intersect bitArray bitLen 8 4.6810 ns/op 4.7030 ns/op 1.00
intersect array and set length 8 29.085 ns/op 30.387 ns/op 0.96
intersect bitArray bitLen 128 23.449 ns/op 23.902 ns/op 0.98
intersect array and set length 128 481.42 ns/op 507.80 ns/op 0.95
bitArray.getTrueBitIndexes() bitLen 128 1.0470 us/op 1.0560 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 248 1.8180 us/op 1.7740 us/op 1.02
bitArray.getTrueBitIndexes() bitLen 512 3.7940 us/op 3.5750 us/op 1.06
Full columns - reconstruct all 6 blobs 119.84 us/op 169.92 us/op 0.71
Full columns - reconstruct half of the blobs out of 6 93.059 us/op 99.791 us/op 0.93
Full columns - reconstruct single blob out of 6 69.598 us/op 33.817 us/op 2.06
Half columns - reconstruct all 6 blobs 373.84 ms/op 387.13 ms/op 0.97
Half columns - reconstruct half of the blobs out of 6 188.00 ms/op 189.62 ms/op 0.99
Half columns - reconstruct single blob out of 6 65.975 ms/op 66.777 ms/op 0.99
Full columns - reconstruct all 10 blobs 191.00 us/op 322.23 us/op 0.59
Full columns - reconstruct half of the blobs out of 10 172.52 us/op 97.820 us/op 1.76
Full columns - reconstruct single blob out of 10 29.749 us/op 93.439 us/op 0.32
Half columns - reconstruct all 10 blobs 597.57 ms/op 638.96 ms/op 0.94
Half columns - reconstruct half of the blobs out of 10 320.60 ms/op 327.64 ms/op 0.98
Half columns - reconstruct single blob out of 10 67.222 ms/op 70.524 ms/op 0.95
Full columns - reconstruct all 20 blobs 1.5291 ms/op 1.9306 ms/op 0.79
Full columns - reconstruct half of the blobs out of 20 271.77 us/op 170.51 us/op 1.59
Full columns - reconstruct single blob out of 20 30.269 us/op 87.358 us/op 0.35
Half columns - reconstruct all 20 blobs 1.2278 s/op 1.2618 s/op 0.97
Half columns - reconstruct half of the blobs out of 20 626.04 ms/op 623.36 ms/op 1.00
Half columns - reconstruct single blob out of 20 66.615 ms/op 66.393 ms/op 1.00
Set add up to 64 items then delete first 1.9448 us/op 2.6155 us/op 0.74
OrderedSet add up to 64 items then delete first 3.0939 us/op 3.4206 us/op 0.90
Set add up to 64 items then delete last 1.9446 us/op 2.4358 us/op 0.80
OrderedSet add up to 64 items then delete last 3.0247 us/op 3.4660 us/op 0.87
Set add up to 64 items then delete middle 1.9653 us/op 2.2448 us/op 0.88
OrderedSet add up to 64 items then delete middle 4.4753 us/op 4.8724 us/op 0.92
Set add up to 128 items then delete first 4.4301 us/op 4.2910 us/op 1.03
OrderedSet add up to 128 items then delete first 6.9345 us/op 6.3762 us/op 1.09
Set add up to 128 items then delete last 4.6675 us/op 4.0730 us/op 1.15
OrderedSet add up to 128 items then delete last 6.5779 us/op 6.1462 us/op 1.07
Set add up to 128 items then delete middle 4.3989 us/op 4.0987 us/op 1.07
OrderedSet add up to 128 items then delete middle 12.738 us/op 12.062 us/op 1.06
Set add up to 256 items then delete first 8.1860 us/op 7.9847 us/op 1.03
OrderedSet add up to 256 items then delete first 12.050 us/op 11.842 us/op 1.02
Set add up to 256 items then delete last 7.4891 us/op 8.0574 us/op 0.93
OrderedSet add up to 256 items then delete last 14.571 us/op 12.194 us/op 1.19
Set add up to 256 items then delete middle 9.4511 us/op 7.9843 us/op 1.18
OrderedSet add up to 256 items then delete middle 38.410 us/op 35.549 us/op 1.08
pass gossip attestations to forkchoice per slot 2.5499 ms/op 2.5434 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 369.86 us/op 445.40 us/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 0 2.2407 ms/op 2.6480 ms/op 0.85
forkChoice updateHead vc 1000000 bc 64 eq 0 3.8429 ms/op 4.3897 ms/op 0.88
forkChoice updateHead vc 600000 bc 320 eq 0 2.3345 ms/op 2.7541 ms/op 0.85
forkChoice updateHead vc 600000 bc 1200 eq 0 2.3438 ms/op 2.7773 ms/op 0.84
forkChoice updateHead vc 600000 bc 7200 eq 0 3.0249 ms/op 3.1251 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 1000 2.9163 ms/op 3.3865 ms/op 0.86
forkChoice updateHead vc 600000 bc 64 eq 10000 2.8255 ms/op 3.5301 ms/op 0.80
forkChoice updateHead vc 600000 bc 64 eq 300000 6.6217 ms/op 7.2509 ms/op 0.91
computeDeltas 1400000 validators 0% inactive 12.011 ms/op 14.086 ms/op 0.85
computeDeltas 1400000 validators 10% inactive 11.085 ms/op 12.833 ms/op 0.86
computeDeltas 1400000 validators 20% inactive 10.106 ms/op 11.872 ms/op 0.85
computeDeltas 1400000 validators 50% inactive 7.7466 ms/op 9.3257 ms/op 0.83
computeDeltas 2100000 validators 0% inactive 17.726 ms/op 20.515 ms/op 0.86
computeDeltas 2100000 validators 10% inactive 16.425 ms/op 19.202 ms/op 0.86
computeDeltas 2100000 validators 20% inactive 15.073 ms/op 17.925 ms/op 0.84
computeDeltas 2100000 validators 50% inactive 8.7943 ms/op 13.972 ms/op 0.63
altair processAttestation - 250000 vs - 7PWei normalcase 2.2433 ms/op 1.7126 ms/op 1.31
altair processAttestation - 250000 vs - 7PWei worstcase 2.8525 ms/op 2.4640 ms/op 1.16
altair processAttestation - setStatus - 1/6 committees join 93.573 us/op 104.61 us/op 0.89
altair processAttestation - setStatus - 1/3 committees join 176.91 us/op 199.66 us/op 0.89
altair processAttestation - setStatus - 1/2 committees join 270.14 us/op 285.55 us/op 0.95
altair processAttestation - setStatus - 2/3 committees join 346.21 us/op 363.17 us/op 0.95
altair processAttestation - setStatus - 4/5 committees join 472.79 us/op 510.43 us/op 0.93
altair processAttestation - setStatus - 100% committees join 551.18 us/op 598.67 us/op 0.92
altair processBlock - 250000 vs - 7PWei normalcase 3.6455 ms/op 3.3286 ms/op 1.10
altair processBlock - 250000 vs - 7PWei normalcase hashState 13.207 ms/op 14.960 ms/op 0.88
altair processBlock - 250000 vs - 7PWei worstcase 20.101 ms/op 19.761 ms/op 1.02
altair processBlock - 250000 vs - 7PWei worstcase hashState 39.848 ms/op 39.609 ms/op 1.01
phase0 processBlock - 250000 vs - 7PWei normalcase 1.2459 ms/op 1.3078 ms/op 0.95
phase0 processBlock - 250000 vs - 7PWei worstcase 16.436 ms/op 15.627 ms/op 1.05
altair processEth1Data - 250000 vs - 7PWei normalcase 269.60 us/op 304.57 us/op 0.89
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.0280 us/op 3.0290 us/op 1.00
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 19.699 us/op 20.661 us/op 0.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 5.3660 us/op 5.7200 us/op 0.94
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 3.6350 us/op 3.6920 us/op 0.98
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 87.814 us/op 97.256 us/op 0.90
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.2987 ms/op 1.4068 ms/op 0.92
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.6927 ms/op 1.8307 ms/op 0.92
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7084 ms/op 1.8280 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.4910 ms/op 3.6545 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.9467 ms/op 2.1026 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.6055 ms/op 4.0862 ms/op 0.88
Tree 40 250000 create 303.44 ms/op 318.30 ms/op 0.95
Tree 40 250000 get(125000) 87.614 ns/op 102.20 ns/op 0.86
Tree 40 250000 set(125000) 952.64 ns/op 1.0804 us/op 0.88
Tree 40 250000 toArray() 11.904 ms/op 9.4532 ms/op 1.26
Tree 40 250000 iterate all - toArray() + loop 12.590 ms/op 9.4300 ms/op 1.34
Tree 40 250000 iterate all - get(i) 37.574 ms/op 35.324 ms/op 1.06
Array 250000 create 2.0508 ms/op 2.1218 ms/op 0.97
Array 250000 clone - spread 644.99 us/op 661.54 us/op 0.97
Array 250000 get(125000) 0.28300 ns/op 0.29500 ns/op 0.96
Array 250000 set(125000) 0.28600 ns/op 0.30000 ns/op 0.95
Array 250000 iterate all - loop 55.355 us/op 57.106 us/op 0.97
phase0 afterProcessEpoch - 250000 vs - 7PWei 44.039 ms/op 38.507 ms/op 1.14
Array.fill - length 1000000 2.0334 ms/op 2.3946 ms/op 0.85
Array push - length 1000000 8.5811 ms/op 7.1657 ms/op 1.20
Array.get 0.19874 ns/op 0.20359 ns/op 0.98
Uint8Array.get 0.23022 ns/op 0.25795 ns/op 0.89
phase0 beforeProcessEpoch - 250000 vs - 7PWei 15.740 ms/op 12.708 ms/op 1.24
altair processEpoch - mainnet_e81889 252.86 ms/op 234.88 ms/op 1.08
mainnet_e81889 - altair beforeProcessEpoch 14.438 ms/op 13.939 ms/op 1.04
mainnet_e81889 - altair processJustificationAndFinalization 5.9840 us/op 4.7570 us/op 1.26
mainnet_e81889 - altair processInactivityUpdates 3.3678 ms/op 3.5946 ms/op 0.94
mainnet_e81889 - altair processRewardsAndPenalties 18.248 ms/op 17.730 ms/op 1.03
mainnet_e81889 - altair processRegistryUpdates 532.00 ns/op 525.00 ns/op 1.01
mainnet_e81889 - altair processSlashings 127.00 ns/op 133.00 ns/op 0.95
mainnet_e81889 - altair processEth1DataReset 123.00 ns/op 130.00 ns/op 0.95
mainnet_e81889 - altair processEffectiveBalanceUpdates 8.0497 ms/op 1.6975 ms/op 4.74
mainnet_e81889 - altair processSlashingsReset 668.00 ns/op 696.00 ns/op 0.96
mainnet_e81889 - altair processRandaoMixesReset 1.2620 us/op 1.0240 us/op 1.23
mainnet_e81889 - altair processHistoricalRootsUpdate 123.00 ns/op 133.00 ns/op 0.92
mainnet_e81889 - altair processParticipationFlagUpdates 415.00 ns/op 435.00 ns/op 0.95
mainnet_e81889 - altair processSyncCommitteeUpdates 96.000 ns/op 105.00 ns/op 0.91
mainnet_e81889 - altair afterProcessEpoch 39.047 ms/op 40.675 ms/op 0.96
capella processEpoch - mainnet_e217614 750.45 ms/op 804.09 ms/op 0.93
mainnet_e217614 - capella beforeProcessEpoch 57.496 ms/op 65.442 ms/op 0.88
mainnet_e217614 - capella processJustificationAndFinalization 5.8880 us/op 5.7320 us/op 1.03
mainnet_e217614 - capella processInactivityUpdates 13.250 ms/op 12.122 ms/op 1.09
mainnet_e217614 - capella processRewardsAndPenalties 83.030 ms/op 91.793 ms/op 0.90
mainnet_e217614 - capella processRegistryUpdates 4.2480 us/op 4.4810 us/op 0.95
mainnet_e217614 - capella processSlashings 121.00 ns/op 133.00 ns/op 0.91
mainnet_e217614 - capella processEth1DataReset 120.00 ns/op 128.00 ns/op 0.94
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.138 ms/op 5.5394 ms/op 2.37
mainnet_e217614 - capella processSlashingsReset 643.00 ns/op 676.00 ns/op 0.95
mainnet_e217614 - capella processRandaoMixesReset 1.0520 us/op 1.1050 us/op 0.95
mainnet_e217614 - capella processHistoricalRootsUpdate 122.00 ns/op 132.00 ns/op 0.92
mainnet_e217614 - capella processParticipationFlagUpdates 406.00 ns/op 425.00 ns/op 0.96
mainnet_e217614 - capella afterProcessEpoch 104.97 ms/op 105.50 ms/op 0.99
phase0 processEpoch - mainnet_e58758 291.79 ms/op 269.48 ms/op 1.08
mainnet_e58758 - phase0 beforeProcessEpoch 62.370 ms/op 50.596 ms/op 1.23
mainnet_e58758 - phase0 processJustificationAndFinalization 5.9830 us/op 5.2700 us/op 1.14
mainnet_e58758 - phase0 processRewardsAndPenalties 15.394 ms/op 15.723 ms/op 0.98
mainnet_e58758 - phase0 processRegistryUpdates 5.6850 us/op 2.2470 us/op 2.53
mainnet_e58758 - phase0 processSlashings 352.00 ns/op 133.00 ns/op 2.65
mainnet_e58758 - phase0 processEth1DataReset 120.00 ns/op 242.00 ns/op 0.50
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 779.99 us/op 865.09 us/op 0.90
mainnet_e58758 - phase0 processSlashingsReset 870.00 ns/op 807.00 ns/op 1.08
mainnet_e58758 - phase0 processRandaoMixesReset 1.2200 us/op 1.1850 us/op 1.03
mainnet_e58758 - phase0 processHistoricalRootsUpdate 125.00 ns/op 144.00 ns/op 0.87
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.1360 us/op 1.0110 us/op 1.12
mainnet_e58758 - phase0 afterProcessEpoch 33.592 ms/op 32.971 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 968.52 us/op 1.0137 ms/op 0.96
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5195 ms/op 1.5801 ms/op 0.96
altair processInactivityUpdates - 250000 normalcase 10.952 ms/op 10.364 ms/op 1.06
altair processInactivityUpdates - 250000 worstcase 11.141 ms/op 10.746 ms/op 1.04
phase0 processRegistryUpdates - 250000 normalcase 3.0970 us/op 2.1820 us/op 1.42
phase0 processRegistryUpdates - 250000 badcase_full_deposits 138.66 us/op 150.51 us/op 0.92
phase0 processRegistryUpdates - 250000 worstcase 0.5 66.196 ms/op 65.494 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 14.910 ms/op 14.130 ms/op 1.06
altair processRewardsAndPenalties - 250000 worstcase 15.249 ms/op 13.666 ms/op 1.12
phase0 getAttestationDeltas - 250000 normalcase 5.1574 ms/op 5.3433 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 5.1186 ms/op 5.4047 ms/op 0.95
phase0 processSlashings - 250000 worstcase 57.125 us/op 63.691 us/op 0.90
altair processSyncCommitteeUpdates - 250000 9.6596 ms/op 10.120 ms/op 0.95
BeaconState.hashTreeRoot - No change 159.00 ns/op 172.00 ns/op 0.92
BeaconState.hashTreeRoot - 1 full validator 70.545 us/op 71.400 us/op 0.99
BeaconState.hashTreeRoot - 32 full validator 859.56 us/op 712.14 us/op 1.21
BeaconState.hashTreeRoot - 512 full validator 7.3886 ms/op 7.6633 ms/op 0.96
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 90.229 us/op 87.494 us/op 1.03
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3433 ms/op 1.3270 ms/op 1.01
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.801 ms/op 16.627 ms/op 0.89
BeaconState.hashTreeRoot - 1 balances 66.283 us/op 72.644 us/op 0.91
BeaconState.hashTreeRoot - 32 balances 728.87 us/op 584.71 us/op 1.25
BeaconState.hashTreeRoot - 512 balances 5.6362 ms/op 5.6642 ms/op 1.00
BeaconState.hashTreeRoot - 250000 balances 118.73 ms/op 116.25 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 18.554 us/op 19.810 us/op 0.94
regular array get 100000 times 21.970 us/op 22.546 us/op 0.97
wrappedArray get 100000 times 21.998 us/op 22.522 us/op 0.98
arrayWithProxy get 100000 times 9.3523 ms/op 12.346 ms/op 0.76
ssz.Root.equals 20.451 ns/op 21.317 ns/op 0.96
byteArrayEquals 20.298 ns/op 21.131 ns/op 0.96
Buffer.compare 8.3790 ns/op 9.4280 ns/op 0.89
processSlot - 1 slots 8.1180 us/op 8.6680 us/op 0.94
processSlot - 32 slots 1.7593 ms/op 1.5905 ms/op 1.11
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.3016 ms/op 3.1268 ms/op 1.38
getCommitteeAssignments - req 1 vs - 250000 vc 1.6019 ms/op 1.6722 ms/op 0.96
getCommitteeAssignments - req 100 vs - 250000 vc 3.2737 ms/op 3.3762 ms/op 0.97
getCommitteeAssignments - req 1000 vs - 250000 vc 3.5153 ms/op 3.6217 ms/op 0.97
findModifiedValidators - 10000 modified validators 782.74 ms/op 598.28 ms/op 1.31
findModifiedValidators - 1000 modified validators 576.64 ms/op 416.51 ms/op 1.38
findModifiedValidators - 100 modified validators 287.00 ms/op 280.72 ms/op 1.02
findModifiedValidators - 10 modified validators 284.74 ms/op 224.02 ms/op 1.27
findModifiedValidators - 1 modified validators 156.55 ms/op 239.51 ms/op 0.65
findModifiedValidators - no difference 179.82 ms/op 162.00 ms/op 1.11
migrate state 1500000 validators, 3400 modified, 2000 new 2.9764 s/op 2.8656 s/op 1.04
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.5500 ns/op 3.7700 ns/op 0.94
state getBlockRootAtSlot - 250000 vs - 7PWei 387.84 ns/op 296.49 ns/op 1.31
computeProposerIndex 100000 validators 1.2516 ms/op 1.3497 ms/op 0.93
getNextSyncCommitteeIndices 1000 validators 2.7296 ms/op 2.9240 ms/op 0.93
getNextSyncCommitteeIndices 10000 validators 24.386 ms/op 25.655 ms/op 0.95
getNextSyncCommitteeIndices 100000 validators 79.537 ms/op 89.022 ms/op 0.89
computeProposers - vc 250000 528.12 us/op 559.88 us/op 0.94
computeEpochShuffling - vc 250000 37.791 ms/op 41.535 ms/op 0.91
getNextSyncCommittee - vc 250000 9.0482 ms/op 9.6895 ms/op 0.93
nodejs block root to RootHex using toHex 84.635 ns/op 115.71 ns/op 0.73
nodejs block root to RootHex using toRootHex 49.322 ns/op 58.777 ns/op 0.84
nodejs fromHex(blob) 708.42 us/op 812.24 us/op 0.87
nodejs fromHexInto(blob) 598.24 us/op 648.58 us/op 0.92
nodejs block root to RootHex using the deprecated toHexString 456.73 ns/op 491.71 ns/op 0.93
nodejs byteArrayEquals 32 bytes (block root) 24.867 ns/op 26.408 ns/op 0.94
nodejs byteArrayEquals 48 bytes (pubkey) 35.705 ns/op 38.072 ns/op 0.94
nodejs byteArrayEquals 96 bytes (signature) 32.202 ns/op 37.086 ns/op 0.87
nodejs byteArrayEquals 1024 bytes 38.628 ns/op 44.226 ns/op 0.87
nodejs byteArrayEquals 131072 bytes (blob) 1.6650 us/op 1.7770 us/op 0.94
browser block root to RootHex using toHex 136.19 ns/op 147.23 ns/op 0.92
browser block root to RootHex using toRootHex 123.81 ns/op 131.49 ns/op 0.94
browser fromHex(blob) 1.4206 ms/op 1.6200 ms/op 0.88
browser fromHexInto(blob) 591.80 us/op 665.80 us/op 0.89
browser block root to RootHex using the deprecated toHexString 456.62 ns/op 344.73 ns/op 1.32
browser byteArrayEquals 32 bytes (block root) 26.531 ns/op 28.154 ns/op 0.94
browser byteArrayEquals 48 bytes (pubkey) 37.403 ns/op 39.677 ns/op 0.94
browser byteArrayEquals 96 bytes (signature) 69.956 ns/op 74.343 ns/op 0.94
browser byteArrayEquals 1024 bytes 712.95 ns/op 759.81 ns/op 0.94
browser byteArrayEquals 131072 bytes (blob) 89.838 us/op 96.155 us/op 0.93

by benchmarkbot/action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants